12095ffa34eb3bc0e8aafbb0fb7eaa4d9fc7946f,marytts-runtime/src/main/java/marytts/htsengine/CartTreeSet.java,CartTreeSet,searchDurInCartTree,#HTSModel#FeatureVector#HMMData#boolean#boolean#number#,176

Before Change


        
        //System.out.format("   state=%d  dur=%d  dd=%f  mean=%f  vari=%f \n", s, m.getDur(s), dd, meanVector[s], varVector[s]);               
        m.setTotalDur(m.getTotalDur() + m.getDur(s));      
        dd = dd + ( data - (double)m.getDur(s) );       
      }
      return dd; 
      

After Change


          
      dd = diffdur;
      // in duration the length of the vector is the number of states.
      for(int s=0; s<numStates; s++){
        data = (meanVector[s] + rho * varVector[s]) * durscale;
      
        /* check if the model is initial/final pause, if so reduce the length of the pause 
         * to 10% of the calculated value. */       
//        if(m.getPhoneName().contentEquals("_") && (firstPh || lastPh ))
//          data = data * 0.1;
        
        m.setDur(s, (int)(data+dd+0.5));
        if(m.getDur(s) < 1 )
          m.setDur(s, 1);
        
        //System.out.format("   state=%d  dur=%d  dd=%f  mean=%f  vari=%f \n", s, m.getDur(s), dd, meanVector[s], varVector[s]);               
        m.incrTotalDur(m.getDur(s));      
        dd += data - m.getDur(s);
      }
      m.setDurError(dd);
      return dd;